package cn.com.sbell.vss.csg.vap;

import org.dom4j.Element;

import cn.com.sbell.vss.VssConstants;
import cn.com.sbell.vss.VssException;
import cn.com.sbell.vss.csg.vsclient.VsClient;
import cn.com.sbell.vss.csg.vsclient.util.PropertiesHolder;

public class InitDeviceId extends AbstractVsCommander {

	protected Element executeCommand(VsClient vsClient,
			PropertiesHolder holder, Element root) {
		String id = toString(holder.getStrProperty("deviceId"));
		if(!vsClient.setDeviceId(id)){
			throw new VssException(VssConstants.CODE_VS_SETDEVICEID_FAILED);
		}
		return root;
	}

}
